package net.huashitong.Indicators.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.Indicators.dao.MenusAuthDao;
import net.huashitong.Indicators.entity.MenusAuth;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MenusAuthService extends StringPKService<MenusAuth> {

    @Autowired
    private MenusAuthDao dao;

    @Autowired
    private SysTableService tabservice;

    @Override
    protected BaseDao<MenusAuth, String> getDao() {
        return dao;
    }

    @Override
    protected void beforeSave(MenusAuth obj) {
        obj.setSysId(tabservice.updateMaxSysId("menusAuth", null));
    }


    public  MenusAuth getByUserId(String userId){
        return dao.getByUserId(userId);
    }
}
